﻿package mortal.game.view.common
{
    import com.gengine.utils.*;

    public class ClassTypesUtil extends Object
    {

        public function ClassTypesUtil()
        {
            return;
        }// end function

        public static function isArrayTheSameValue(param1:Array, param2:Array) : Boolean
        {
            if (param1 == null && param2 == null)
            {
                return true;
            }
            if (param1 == null || param2 == null)
            {
                return false;
            }
            if (param1.length != param2.length)
            {
                return false;
            }
            if (param1.length == 0 && param2.length == 0)
            {
                return true;
            }
            var _loc_3:int = 0;
            while (_loc_3 < param1.length)
            {
                
                if (param1[_loc_3] != param2[_loc_3])
                {
                    return false;
                }
                _loc_3++;
            }
            return true;
        }// end function

        public static function getBitValue(param1:int, param2:int) : int
        {
            if (param2 < 0)
            {
                return 0;
            }
            var _loc_3:* = 1 << param2;
            return (param1 & _loc_3) >> param2;
        }// end function

        public static function getSetBitValueResult(param1:int, param2:int, param3:int) : int
        {
            if (param2 < 0)
            {
                return param1;
            }
            var _loc_4:* = param3 << param2;
            var _loc_5:* = ~(1 << param2);
            param1 = param1 & _loc_5;
            return param1 | _loc_4;
        }// end function

        public static function getHighestBitPlace(param1:int) : int
        {
            var _loc_2:int = 31;
            while (_loc_2 > 0)
            {
                
                if ((1 << (_loc_2 - 1) & param1) > 0)
                {
                    return _loc_2;
                }
                _loc_2 = _loc_2 - 1;
            }
            return 0;
        }// end function

        public static function copyValue(param1:Object, param2:Object) : void
        {
            var _loc_3:Object = null;
            for (_loc_3 in param2)
            {
                
                param1[_loc_3] = param2[_loc_3];
            }
            return;
        }// end function

        public static function copyClassValue(param1:Object, param2:Object, param3:Boolean = true) : void
        {
            var _loc_5:Object = null;
            var _loc_4:* = ObjectParser.getClassVars(param2, param3);
            for each (_loc_5 in _loc_4)
            {
                
                param1[_loc_5] = param2[_loc_5];
            }
            return;
        }// end function

    }
}
